package com.chenxbook.modules.examples.custom;

import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;

import java.util.Map;

/**
 * 自定义活动
 */
public class PrintDots implements ExternalActivityBehaviour {
    @Override
    public void execute(ActivityExecution execution) throws Exception {
        //使流程陷入"等待"状态，等待一个执行信号使流程引擎进入signal方法的处理
        execution.waitForSignal();
    }

    @Override
    public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
        //活动收到信号后，进入到这里
        //调用下面的方法使流程实例进入下一步活动
        execution.take(signalName);
    }


}
